<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <button onclick=yz()>点击获取验证码</button>
</body>
</html>
<script>
function yz() {
    var btn = document.querySelector('button')
    var js = 60
    btn.disabled = true
    var yanzheng = setInterval(function () {
        if(js > 0){
            js--
            btn.textContent='重新发送（'+js+'）'
        }else{
            clearInterval(yanzheng)
            btn.textContent = '点击获取验证码'
            btn.disabled = false
        }
    },1000)
}
</script>